<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>UID参数处理测试</title>
</head>
<body>
    <h1>UID参数处理测试</h1>
    <div id="result"></div>

    <script>
        // 获取URL参数的函数
        function getUrlParameter(name) {
            name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');
            var regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');
            var results = regex.exec(window.location.search);
            return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));
        }

        // 测试UID参数处理
        function testUidHandling() {
            var uid = getUrlParameter('uid');
            if (!uid || uid === '') {
                uid = 204; // 默认uid
            }
            
            document.getElementById('result').innerHTML = '<p>当前UID值: ' + uid + '</p>';
        }

        // 页面加载完成后运行测试
        document.addEventListener('DOMContentLoaded', function() {
            testUidHandling();
        });
    </script>
</body>
</html>